package com.zhuge_new.Activity;

import android.app.Activity;

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NavigationRes;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.zhuge_new.Adapter.RedFragmentAdapter;
import com.zhuge_new.Base.BaseActivity;
import com.zhuge_new.Fragment.RedexanmineFragmen1;
import com.zhuge_new.Fragment.RedexanmineFragmen2;
import com.zhuge_new.R;
import com.zhuge_new.untils.ActivityStack;
import com.zhuge_new.untils.StatusBarUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lenovo on 2018-09-11.
 */

public class RedExanmineActivity extends FragmentActivity {

    private List<Fragment> listFragment;
    private int tvWidth=0;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.redexanmine);
        initView();
        StatusBarUtil.setStatusBarColor(RedExanmineActivity.this,R.color.redd9);
    }
    private void initView() {

        ImageView iv_back=findViewById(R.id.iv_back);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

        ViewPager vp_bank_red=findViewById(R.id.vp_bank_red);
        TabLayout backcard_tab=findViewById(R.id.backcard_tab);
        RedexanmineFragmen1 redexanmineFragmen1=new RedexanmineFragmen1();

        RedexanmineFragmen2 redexanmineFragmen2=new RedexanmineFragmen2();

        listFragment=new ArrayList<>();
        listFragment.add(redexanmineFragmen1);
        listFragment.add(redexanmineFragmen2);

        RedFragmentAdapter redFragmentAdapter=new RedFragmentAdapter(getSupportFragmentManager(),listFragment);

        vp_bank_red.setAdapter(redFragmentAdapter);
        backcard_tab.setupWithViewPager(vp_bank_red);

        backcard_tab.getTabAt(0).setText("我收到的");
        backcard_tab.getTabAt(1).setText("我发出的");
    }

}
